import request from '../api/baseApi';
// import * as qs from 'autoprefixer';
// import qs from 'qs';

// import qs from 'qs';

// 获取当前用户订单信息
export const orderInfo = (datas) => {
  return request({
    method: 'GET',
    url: '/order',
    params: datas
  });
};
export const PayForGoods = datas => {
  let Pay = '/order/generate?';
  for (let i = 0; i < datas.cartGoodsIds.length; i++) {
    Pay = Pay + 'cartGoodsIds=' + datas.cartGoodsIds[i] + '&';
  }
  return request({
    method: 'GET',
    // eslint-disable-next-line camelcase
    url: Pay + 'customerAddrId=' + datas.customerAddrId + '&point=' + datas.point
  });
};

// 根据秒杀商品id生成订单
export const PayForSecGoods = (datas) => {
  return request({
    method: 'POST',
    url: '/order/generateSec',
    params: datas
  });
};
